package com.cn.service;

import com.cn.entity.User;
import com.cn.service.fallback.UserServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: chenyuncong
 * @Date: 2019/12/4 17:40
 */
@FeignClient(name = "service-provider",path="user", fallbackFactory = UserServiceFallbackFactory.class, decode404 = true)
public interface UserService {
    @GetMapping("getUserById")
    User getUserById(@RequestParam("id") Integer id);
    @PostMapping("getUserByName")
    User getUserByName(@RequestParam("name") String name);

}
